<extend name="Public/base" />

<block name="style">
	<style>
		.page-content{padding:15px 10px;}
		.search_pannl_div .single-col label{width:75px;}
	</style>
</block>

<block name="body">
	<!-- 弹窗插件 -->
    <include file="Public:artdialog" />
	<div class="form-inline" style="margin-bottom:10px" >
		<div class="form-group">
			<input type="text" size="30" style="height:40px" class="form-control " id="code" placeholder="请输入运单号">
		</div>
		<button  class="btn btn-primary btn-lg glyphicon glyphicon-search"  onclick="sub_logistics()">物流查询</button>
	</div>


 <iframe id="mainFrame" name="mainFrame" scrolling="no" border="0" style="padding: 0px; width: 100%; height: 1200px" ></iframe> 


</block>

<block name="script">
<script type="text/javascript">
$(function(){
    $("#mainFrame").on("load",function(){
        //加载完成，需要执行的代码
        art.dialog.list['Tips'].close();

    });
});


/**
 * 短暂提示
 * @param	{String}	提示内容
 * @param	{Number}	显示时间 (默认1.5秒)
 */
 function artDialog_tips(content) {
    return artDialog({
        id: 'Tips',
        title: false,
        cancel: false,
        fixed: true,
        lock: true
    })
    .content('<div style="padding: 0 1em;">' + content + '</div>')
    
};
 
function  sub_logistics(){
   var code = $('#code').val();
   if(code ==""){
   	 alert('请输入运单号');
   	 return false;
   }

   	     $.ajax({
             'url': "{:U('Logistics/logistics_query')}",
             'data': {'code':code},
             'dataType': 'json',
             'type': 'POST',
             success: function (data) {
             	debugger;
                 if (data.status ==1) {  
                    $("#mainFrame").attr("src",data.info);
                     artDialog_tips('正在加载......');
                 }else{
                 	alert(data.info);
                 }

             }, error: function (err) { 
                alert('网络错误!');
             },complete: function () {
                
             }
         });
}


</script>
</block>

